package cn.buk.tms.dto;

import cn.buk.common.util.DecimalUtil;

import static cn.buk.tms.common.constant.TmsOrderConstant.*;

/**
 * 统计报表的内容 子项目
 *
 * @author yfdai
 */
public class ReportStatSubItemDto {

	/**
	 * 项目类型
	 */
	private String billType;

	/**
	 * 项目类型名称
	 */
	private String billTypeName;

	/**
	 * 客户名称
	 */
	private String customerName;

	private int count;

	private double totalAmount;

	private double totalCost;

	private double totalProfit;


	public int getCount() {
		return count;
	}

	public void setCount(int count) {
		this.count = count;
	}

	public double getTotalAmount() {
		return totalAmount;
	}

	public void setTotalAmount(double totalAmount) {
		this.totalAmount = DecimalUtil.keepScale2(totalAmount);
	}

	public double getTotalCost() {
		return totalCost;
	}

	public void setTotalCost(double totalCost) {
		this.totalCost = DecimalUtil.keepScale2(totalCost);
	}

	public double getTotalProfit() {
		return totalProfit;
	}

	public void setTotalProfit(double totalProfit) {
		this.totalProfit = DecimalUtil.keepScale2(totalProfit);
	}

	public String getBillTypeName() {
		return billTypeName;
	}

	public void setBillTypeName(String billTypeName) {
		this.billTypeName = billTypeName;
	}

	public String getBillType() {
		return billType;
	}

	public void setBillType(String billType) {
		this.billType = billType;
		if (BILL_TYPE_FLIGHT.equalsIgnoreCase(this.billType)) {
			this.billTypeName = "机票";
		} else if (BILL_TYPE_FLIGHT_REFUND.equalsIgnoreCase(this.billType)) {
			this.billTypeName = "退票";
		} else if (BILL_TYPE_FLIGHT_CHANGE.equalsIgnoreCase(this.billType)) {
			this.billTypeName = "改签";
		} else if (BILL_TYPE_VAS.equalsIgnoreCase(this.billType)) {
			this.billTypeName = "服务";
		} else if (BILL_TYPE_HOTEL.equalsIgnoreCase(this.billType)) {
			this.billTypeName = "酒店";
		} else if (BILL_TYPE_TRAIN.equalsIgnoreCase(this.billType)) {
			this.billTypeName = "火车票";
		} else if (BILL_TYPE_CAR.equalsIgnoreCase(this.billType)) {
			this.billTypeName = "用车";
		} else {
			this.billTypeName = billType;
		}
	}

	public String getCustomerName() {
		return customerName;
	}

	public void setCustomerName(String customerName) {
		this.customerName = customerName;
	}
}
